import request from '@/utils/request'

// 获取区域下拉列表
export function getRegionList() {
  return request({
    url: '/dispatch/web/dispatchRegionalAlarmConfig/regionList',
    method: 'get'
  })
}

// 获取监测量类型下拉列表
export function getMonitoringTypeList() {
  return request({
    url: '/dispatch/web/dispatchRegionalAlarmConfig/monitoringTypeList',
    method: 'get'
  })
}

// 获取条件下拉列表
export function getConditionList() {
  return request({
    url: '/dispatch/web/dispatchRegionalAlarmConfig/conditionList',
    method: 'get'
  })
}

// 获取推送对象下拉列表
export function getPushObjectList() {
  return request({
    url: '/dispatch/web/dispatchRegionalAlarmConfig/pushObjectList',
    method: 'get'
  })
}

// 获取报警级别下拉列表
export function getAlarmLevelList() {
  return request({
    url: '/dispatch/web/dispatchRegionalAlarmConfig/alarmLevelList',
    method: 'get'
  })
}

// 获取推送方法下拉列表
export function getPushMethodList() {
  return request({
    url: '/dispatch/web/dispatchRegionalAlarmConfig/pushMethodList',
    method: 'get'
  })
}

// 查询区域报警配置列表
export function getRegionalAlarmConfigList(params) {
  return request({
    url: '/dispatch/web/dispatchRegionalAlarmConfig/list',
    method: 'get',
    params
  })
}

// 获取区域报警配置详细信息
export function getRegionalAlarmConfigDetail(regionalAlarmConfigId) {
  return request({
    url: `/dispatch/web/dispatchRegionalAlarmConfig/${regionalAlarmConfigId}`,
    method: 'get'
  })
}

// 新增区域报警配置
export function addRegionalAlarmConfig(data) {
  return request({
    url: '/dispatch/web/dispatchRegionalAlarmConfig',
    method: 'post',
    data
  })
}

// 修改区域报警配置
export function updateRegionalAlarmConfig(data) {
  return request({
    url: '/dispatch/web/dispatchRegionalAlarmConfig',
    method: 'put',
    data
  })
}

// 删除区域报警配置
export function deleteRegionalAlarmConfig(regionalAlarmConfigIds) {
  return request({
    url: `/dispatch/web/dispatchRegionalAlarmConfig/${regionalAlarmConfigIds}`,
    method: 'delete'
  })
}

// 删除报警规则配置
export function deleteAlarmRule(ruleId) {
  return request({
    url: `/dispatch/web/dispatchRegionalAlarmConfig/rules/${ruleId}`,
    method: 'delete'
  })
}